<?php

namespace App\Http\Criteria;

use App\Repository\Criteria;
use App\Repository\Constracts\RepositoryInterface as Repository;

class IsActiveCriteria extends Criteria
{
    private $isActive;

    const ACTIVE = 1;
    const UN_ACTIVE = 0;

    public function __construct($isActive = 1)
    {
        $this->isActive = $isActive;
    }

    public function apply($model, Repository $repository)
    {
        return $model->where('is_active', $this->isActive);
    }

}
